#ifndef ADC_H
#define ADC_H

//TODO: En  la documentacion, la funcion de battery_init poner el link de battery.c, y BATT_PIN. tambien poner documentacion externa para las variables
// declaradas en el Makefile, como ON y OFF.

/**
 * @defgroup nxbot_adc ADC Library
 * @ingroup nxbot_low_level
 * @code #include <battery.h> @endcode
 * @brief Interrupt ADC library for checking the state of the %battery and 7 additional ADC channels in NXBOT. 
 *
 * This module uses the built-in ADC of the ATmega1281 microcontroller. The %battery is connected to a voltage divider in order to obtain 
 * permisible voltage values for the microcontroller pins. Thus, when using a 6V full-charged %battery, the voltage divider equals 1/2. Using a 
 * 12V full-charged %battery, the voltage divider equals 1/4. The pin used by the microcontroller is the BATT_PIN, defined in %battery.c.
 * The ADC is used at <b>8 bit-resolution</b>, and the readings are <b>interrupt-driven</b>. 
 * That means, the module updates constantly the %battery state variable,
 * only if the interrupts are active. Therefore, it is necessary to enable interrupts, for example via the <i>sei()</i> function.
 */


/**@{*/


void adc_init(void);
unsigned char adc_read(unsigned char channel);
unsigned char adc_getChannel(void);
void adc_setChannel(unsigned char channel);

/**@}*/
#endif
